package com.jawmask.android.stuartproair.ui;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ToggleButton;

import com.jawmask.android.stuartproair.R;
import com.jawmask.android.stuartproair.constants.AppConstants;

public class MaintenanceRemainterActivity extends BaseActivity {

	private ToggleButton springToggle, fallToggle;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.maintenance_remainder, true);
		setTitle(getString(R.string.maintenance_remainder));

		springToggle = (ToggleButton) findViewById(R.id.springToggle);
		fallToggle = (ToggleButton) findViewById(R.id.fallToggle);
	}

	public void scheduleOnClick(final View view) {
		Intent intent = new Intent(this, SchedulerActivity.class);
		startActivity(intent);
	}

	public void maintenanceFilterOnClick(final View view) {
		Intent intent = new Intent();

		switch (view.getId()) {
		case R.id.coolingMaintenanceLayout:
			intent.putExtra(AppConstants.EXTRA_KEY_NAME_MAINTENANCE_ACTION_RESULT, springToggle.isChecked());
			intent.putExtra(AppConstants.EXTRA_KEY_NAME_MAINTENANCE_SELECTED_RESULT, AppConstants.SPRING_TYPE);
			break;
		case R.id.heatingMaintenanceLayout:
			intent.putExtra(AppConstants.EXTRA_KEY_NAME_MAINTENANCE_ACTION_RESULT, springToggle.isChecked());
			intent.putExtra(AppConstants.EXTRA_KEY_NAME_MAINTENANCE_SELECTED_RESULT, AppConstants.FALL_TYPE);
			break;
		}

		intent.setClass(this, FilterRemainderActivity.class);
		startActivity(intent);
	}
}
